<!-- directive:title 可关闭对联广告代码 -->
<!-- directive:breadcrumb 广告备份 -->
<div class="panel-body">
    <p> 2019年6月18日15:28:13 刘美发布 对联广告 </p>
    <table bgcolor="#F4F4F4">
        <tr>
            <td width="100%" valign="top"><p align="center">&nbsp;</p>
                <p>代码整理：<a href="http://www.lanrentuku.com/" target="_blank">懒人图库</a>　</p>
                <p>＊尊重他人劳动成果，转载请自觉注明出处！注：此代码仅供学习交流，请勿用于商业用途。</p>
                <p>左右投放一致的可滚动对联广告代码</p>
            </td>
        </tr>
    </table>
    <script language="JavaScript">
        (function(){
            var AdDivW = 100; //宽度
            var AdDivH = 300; //高度
            var IMG = '../../images/ad.duilian.jpg';
            var LINK = 'http://www.lanrentuku.com/';
            /////////////////////////////////////////
            var Toppx = 200; //上端位置
            var PageWidth = 1200; //页面多少宽度象素下正好不出现左右滚动条
            var MinScreenW = 1440; //显示广告的最小屏幕宽度象素
            var div1, div2;
            function makeDiv(){
                var div = document.createElement('div');
                div.style.position = 'fixed';
                div.style.border = '1px solid #336699';
                div.style.backgroundColor = '#EEEEE2';
                div.style.zIndex = '99999';
                div.style.width = AdDivW + 'px';
                div.style.height = AdDivH + 'px';
                div.style.wordBreak = 'break-all';
                div.style.display = 'block';
                div.style.top = Toppx + 'px';
                var div1 = document.createElement('div');
                div1.style.position = 'absolute';
                div1.style.top = '0';
                div1.style.right = '0';
                div1.style.margin = '2px';
                div1.style.zIndex = '2000';
                var a1 = document.createElement('a');
                a1.style.color = 'red';
                a1.style.textDecoration = 'none';
                a1.style.fontSize = '12px';
                a1.innerHTML = '\u5173\u95ed';
                a1.onclick = hideAd;
                a1.href = "javascript:void(0);"
                div1.appendChild(a1);
                var div2 = document.createElement('div');
                div2.align = "center";
                div2.style.color = 'green';
                div2.style.fontSize = '23pt';
                div2.style.fontFamily = 'microsoft yahei';
                var a2 = document.createElement('a');
                a2.style.color = 'red';
                a2.style.textDecoration = 'none';
                a2.style.fontSize = '12px';
                a2.href = LINK;
                a2.target = '_blank';
                var img2 = document.createElement('img');
                img2.src = IMG;
                img2.style.width = AdDivW + 'px';
                img2.style.height = AdDivH + 'px';
                img2.style.border = '0';
                a2.appendChild(img2);
                div2.appendChild(a2);
                div.appendChild(div1);
                div.appendChild(div2);
                return div
            }
            function showAd(){
                if (window.screen.width < MinScreenW){
                    console.log("临时提示：\n\n显示器分辨率宽度小于" + MinScreenW + ",不显示AD");
                    return;
                }
                var Borderpx = ((window.screen.width - PageWidth) / 2 - AdDivW) / 2;
                div1 = makeDiv();
                div1.style.left = Borderpx + 'px';
                div2 = makeDiv();
                div2.style.right = Borderpx + 'px';
                document.body.appendChild(div1)
                document.body.appendChild(div2)
            }
            function hideAd(){
                div1.style.display="none";
                div2.style.display="none";
            }
            showAd();
        })()
    </script>
</div>